extends "../cTDP/cTDP.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "诗人"
	lv = 2
	attCoe.atkRan = 2
	attCoe.atk = 0 
	attCoe.maxHp = 900 / 112.5 / 2
	attAdd.dod = 0.11
	addSkillTxt("吟唱精通：攻击为0<固化>，每2秒嘲讽一次攻击范围内敌人，11%闪避普攻[史诗为33%，传奇66%]")
	if !att.is_connected("onChange",self,"run"):
		att.connect("onChange",self,"run")
func run(id):
	if id == "atk":
		attCoe.atk = 0
		attAdd.atk = 0
var cnt = 0
func _onAtkChara(atkinfo):
	if !atkinfo.isMiss && atkinfo.atkType == Chara.AtkType.NORMAL:
		atkinfo.hurtVal = 0
	._onAtkChara(atkinfo)

func _onBattleStart():
	._onBattleStart()
	cnt = 0

func _upS():
	._upS()
	if self.isDeath:return
	cnt += 1
	if cnt % 2:return  
	var chas = self.getAllChas(1)
	for i in chas:
		if inrange(i.cell,cell,att.atkRan) && i.aiCha != self:
			i.aiCha = self

func inrange(a,b,c):
	var x = abs(a.x - b.x)
	var y = abs(a.y - b.y)
	return x*x + y*y <= c*c
